﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManageStudent.ascx.cs"
    Inherits="NLLSite.Administrator.UserControl.ManageStudent" %>
<%@ Register assembly="BasicFrame.WebControls.BasicDatePicker" namespace="BasicFrame.WebControls" tagprefix="BDP" %>
<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                Quản lý học viên</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                <asp:Panel ID="Panel2" runat="server" Visible="False">
                    <table style="width:100%;">
                        <tr>
                            <td>
                                Tên học viên:</td>
                            <td>
                                <asp:TextBox ID="txtName" runat="server" Width="200px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="txtName" ErrorMessage="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Điện thoại:</td>
                            <td>
                                <asp:TextBox ID="txtPhone" runat="server" Width="200px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                    ControlToValidate="txtPhone" ErrorMessage="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ngày sinh:</td>
                            <td>
                                <asp:DropDownList ID="ddlDay" runat="server">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlMonth" runat="server" AutoPostBack="True" 
                                    onselectedindexchanged="ddlMonth_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="True" 
                                    onselectedindexchanged="ddlYear_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                Email:</td>
                            <td>
                                <asp:TextBox ID="txtEmail" runat="server" Width="200px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                    ControlToValidate="txtEmail" ErrorMessage="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Công ty:</td>
                            <td>
                                <asp:TextBox ID="txtCompany" runat="server" TextMode="MultiLine" Width="200px" 
                                    Height="80px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                    ControlToValidate="txtCompany" ErrorMessage="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Thông tin khác:</td>
                            <td>
                                <asp:TextBox ID="txtNote" runat="server" TextMode="MultiLine" Width="200px" 
                                    Height="80px"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" CellPadding="4" DataSourceID="LinqDataSource2" 
                                    EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
                                    Width="600px" onselectedindexchanged="GridView2_SelectedIndexChanged">
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    <Columns>
                                        <asp:BoundField DataField="Name" HeaderText="Các khóa học đã đăng ký" 
                                            ReadOnly="True" SortExpression="Name">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:CommandField SelectText="Xóa" ShowSelectButton="True">
                                        <ItemStyle HorizontalAlign="Center" />
                                        </asp:CommandField>
                                        <asp:TemplateField HeaderText="RegCourseID" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDRegCourse" runat="server" Text='<%# Eval("RegisterID") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EditRowStyle BackColor="#999999" />
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                </asp:GridView>
                                <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
                                    ContextTypeName="DAL_Class.NLLDataContext" Select="new (Name, RegisterID)" 
                                    TableName="view_GetCourseNames" Where="CheckInID == @CheckInID">
                                    <WhereParameters>
                                        <asp:SessionParameter DefaultValue="0" Name="CheckInID" 
                                            SessionField="CheckInID" Type="Int32" />
                                    </WhereParameters>
                                </asp:LinqDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                <asp:Button ID="Button1" runat="server" CssClass="altbutton" Text="Lưu lại" 
                                    onclick="Button1_Click" />
                                <asp:Button ID="Button2" runat="server" CssClass="altbutton" Text="Hủy bỏ" 
                                    onclick="Button2_Click" />
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="Panel1" runat="server">
                <table style="width:918px;"><tr><td>
                    <asp:CheckBox ID="cbxCheckAll" runat="server" AutoPostBack="True" 
                        oncheckedchanged="cbxCheckAll_CheckedChanged" />
                    <asp:Button ID="btnDelete" runat="server" CssClass="altbutton" 
                        onclick="btnDelete_Click" 
                        onclientclick="javascript:return confirm('Bạn chắc chắn xóa?')" Text="Xóa" />
                    <asp:Button ID="txtPrint" runat="server" CssClass="altbutton" 
                        onclick="txtPrint_Click" Text="Ghi ra file" />
                    <asp:Label ID="lblString" runat="server"></asp:Label>
                    <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                    </td><td align="right">
                        &nbsp;</td></tr></table>
                    <asp:GridView ID="GridView1" runat="server" CellPadding="4" EnableModelValidation="True"
                        ForeColor="#333333" GridLines="None" AllowPaging="True" AutoGenerateColumns="False"
                        DataKeyNames="ID" DataSourceID="LinqDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                        Width="920px" AllowSorting="True">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbxDelete" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                                SortExpression="ID" Visible="False" />
                            <asp:BoundField DataField="FullName" HeaderText="Tên học viên" SortExpression="FullName" />
                            <asp:BoundField DataField="Phone" HeaderText="Điện thoại" SortExpression="Phone" />
                            <asp:TemplateField HeaderText="Ngày sinh">
                                <ItemTemplate>
                                    <asp:Label ID="lblDOB" runat="server" Text='<%# Eval("DateOfBirth", "{0:d}") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                            <asp:TemplateField Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblCompany" runat="server" Text='<%# Eval("Company") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblNote" runat="server" Text='<%# Eval("Note") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DAL_Class.NLLDataContext"
                        EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="CheckIns">
                    </asp:LinqDataSource>
                </asp:Panel>
            </div>
        </div>
    </div>
</div>



